<template>
<div ref="myChart" id="myChart"></div>
</template>
<script>
import * as echarts from 'echarts'
export default {
mounted(){
	let myChart = echarts.init(this.$refs.myChart)
	let option = {
		title:{
			text:'漏斗图'
		},
		tooltip:{
			trigger:'item',
			formatter:"{b}:{c}%"
		},
		series:{
			type:'funnel',
			data:[
				{value:60,name:'美食'},
				{value:40,name:'日化'},
				{value:20,name:'数码'},
				{value:80,name:'家电'},
				{value:100,name:'蔬菜'},
			],
			left:'10%',//向左平移10%
			bottom:'20%',//距离底部的距离是20%,
			sort:'ascending',//ascending 升序 ，默认是降序, none根据数据在页面呈现
			itemStyle:{
				borderColor:'red',
				borderWidth:3
			},
			label:{
				show:true,
				position:"inside"
			},
			emphasis:{
				label:{fontSize:20}
			}
		}

	}
	myChart.setOption(option)
}
}
</script>
<style scoped>
#myChart{
	width: 500px;
	height: 500px;
	border:1px solid red;
}
</style>
